package com.feihong.txgw.tx_model;

import com.feihong.txgw.inter.contract.integral.IFriendContract;
import com.feihong.txgw.model.bean.invitefriend.InviteFriendsResponseEntity;
import com.feihong.txgw.utils.helper.RxHelper;
import com.feihong.txgw.utils.manage.RetrofitManager;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName InviteFriendMainModel
 * @package com.feihong.txgw.tx_model
 * @data 2018/5/3 18:01
 * @Describe
 * @Change
 */
public class InviteFriendMainModel implements IFriendContract.IFriendMainModel {

    public static InviteFriendMainModel create(){
        return new InviteFriendMainModel();
    }
    @Override
    public Observable getFriendsInfo(String cacheKey) {
//        final Observable observable = RetrofitManager.getInstance().getInviteFriendData("2").compose(RxHelper.<InviteFriendsResponseEntity>rxSchedulerHelper());
//        AbNetWorkCache abNetWorkCache = new AbNetWorkCache() {
//            @Override
//            public Observable get(String key, Class cls) {
//                return observable;
//            }
//        };
//        return CacheManager.getInstance().load(InviteFriendsResponseEntity.class.getName(),InviteFriendsResponseEntity.class,abNetWorkCache);
        return RetrofitManager.getInstance().getInviteFriendData("2").compose(RxHelper.<InviteFriendsResponseEntity>rxSchedulerHelper());
    }
}
